apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: gateway-add-listener
  namespace: gateway-conformance-infra
spec:
  gatewayClassName: "{GATEWAY_CLASS_NAME}"
  listeners:
  - name: https
    port: 443
    protocol: HTTPS
    hostname: "secure.test.com"
    allowedRoutes:
      namespaces:
        from: All
    tls:
      certificateRefs:
      - group: ""
        kind: Secret
        name: tls-validity-checks-certificate
        namespace: gateway-conformance-infra
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: http-route-1
  namespace: gateway-conformance-infra
spec:
  parentRefs:
  - kind: Gateway
    name: gateway-add-listener
    namespace: gateway-conformance-infra
  rules:
  - backendRefs:
    - name: infra-backend-v1
      port: 8080
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: gateway-remove-listener
  namespace: gateway-conformance-infra
spec:
  gatewayClassName: "{GATEWAY_CLASS_NAME}"
  listeners:
  - name: https
    port: 443
    protocol: HTTPS
    hostname: "secure.test.com"
    allowedRoutes:
      namespaces:
        from: All
    tls:
      certificateRefs:
      - group: ""
        kind: Secret
        name: tls-validity-checks-certificate
        namespace: gateway-conformance-infra
  - name: http
    port: 80
    protocol: HTTP
    allowedRoutes:
      namespaces:
        from: All
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: http-route-2
  namespace: gateway-conformance-infra
spec:
  parentRefs:
  - kind: Gateway
    name: gateway-remove-listener
    namespace: gateway-conformance-infra
  rules:
  - backendRefs:
    - name: infra-backend-v1
      port: 8080
